package com.xnyzc.lhy.common.penum.wallet;

public enum EAvailableTimeType {

    workday(0,"工作日"),
    unworkday(1, "非工作日"),
    unlimited(2, "不限");

    private Integer type;
    private String value;

    EAvailableTimeType(Integer type, String value){
        this.type = type;
        this.value = value;
    }

    public static EAvailableTimeType findById(Integer type){
        EAvailableTimeType eAvailableTimeType;
        switch (type){
            case 0:
                eAvailableTimeType  = EAvailableTimeType.workday;
                break;
            case 1:
                eAvailableTimeType = EAvailableTimeType.unworkday;
                break;
            case 2:
                eAvailableTimeType = EAvailableTimeType.unlimited;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return eAvailableTimeType;
    }

    public String getValue(){
        return this.value;
    }
}
